package com.doudou.eurekaConsumer.consumer.feign;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author mazh
 * @date 2021-12-06 9:34
 */
@RestController
public class HelloMsgController {
    private static final Logger logger = LoggerFactory.getLogger(HelloMsgController.class);
    @Autowired
    private HelloInterface helloInterface;

    @GetMapping("/helloMsg")
    public String helloMsg(){
        String helloMsg = helloInterface.getHelloMsg();
        logger.info("com.doudou.eurekaconsumer.consumer.feign.HelloMsgController.helloMsg:{}",helloMsg);
        return helloMsg;
    }

    @GetMapping("/hello")
    public String hello(@RequestParam Map<String, Object> params){
        String helloMsg = helloInterface.hello(params);
        logger.info("com.doudou.eurekaconsumer.consumer.feign.HelloMsgController.hello:{}",helloMsg);
        return helloMsg;
    }
}
